{include file="../header.html" title="图书分类列表"}

	<div id="main">
		<div id="main_title">您当前处于 
			<span class="weightFont">书籍管理</span> >> 
			<span class="softFont">
				{if $typeDetail}{$typeDetail['typename']}类所有书籍
				{else}图书列表
				{/if}
			</span>
		</div>
		<div id="main_body">
			<div class="searchBox">
				<input type="text" id="searchKey" name="searchKey" placeholder="图书号或书名" />
				<span class="searchBtn">搜索</span>
			</div>
			<div><button class="addItemBtn">添加此分类书籍</button></div>
			{if $bookList}
			<center>
				<form id="listForm">
					<table id="typeList" cellpadding="5" cellspacing="0">
						<tr>
							<th>图书号</th>
							<th>图书名</th>
							<th>作者</th>
							<th>出版时间</th>
							<th>是否借出</th>
							<th>上(下)架</th>
							<th class="wider">操作</th>
						</tr>
						{foreach $bookList as $book}
						<tr>
							<td>
								<a href="{$site_url}admin/book_detail.php?id={$book['id']}">
									{$book['bid']}
								</a>
							</td>
							<td>
								<a href="{$site_url}admin/book_detail.php?id={$book['id']}">
									{$book['title']}
								</a>
							</td>
							<td>{$book['author']}</td>
							<td>{$book['pubtime']|date_format:"%Y-%m-%d"}</td>
							<td>
								{foreach $isLend as $k => $v}
								{if $k eq $book.is_lend}{$v}{/if}
								{/foreach}
							</td>
							<td>
								{foreach $isShow as $k => $v}
								{if $k eq $book.is_show}{$v}{/if}
								{/foreach}
							</td>
							<td>
								&nbsp;
								<a href="{$site_url}admin/book_detail.php?id={$book['id']}" class="editBtn">
									编辑
								</a>&nbsp;&nbsp;
								<span class="delBtn" name="{$book['id']}">删除</span>
							</td>
						</tr>
						{/foreach}
					</table>
				</form>
				<!--翻页条-->
				{if $show_pageBox}
				<div class="pageDiv">{$pageBox}</div>
				{/if}
			</center>
			{else}
			<div class="noContent">暂时没有藏书</div>
			{/if}

			<!--添加书籍框-->
			<div class="popBox" style="">
				<center>
				<form id="editForm">
					<table cellpaddin="0" cellspacing="10">
						<thead class="thead">
							<td colspan="2">新书上架</td>
						</thead>
						<tr>
							<th><label for="bid">图&nbsp;书&nbsp;号:</label></th>
							<td>
								<input type="text" name="bid" id="bid" />
							</td>
						</tr>
						<tr>
							<th><label for="title">图&nbsp;书&nbsp;名:</label></th>
							<td>
								<input type="text" name="title" id="title" />
							</td>
						</tr>
						<tr>
							<th>
								<label for="author">作&nbsp;&nbsp;&nbsp;&nbsp;者:</label>
							</th>
							<td>
								<input type="text" name="author" id="author" />
							</td>
						</tr>
						<tr>
							<th>
								<label for="description">简&nbsp;&nbsp;&nbsp;&nbsp;介:</label>
							</th>
							<td>
								<textarea name="description" id="description" cols="20" rows="5" ></textarea>
							</td>
						</tr>
						<tr>
							<th><label for="pubtime">出版时间:</label></th>
							<td>
								<input onclick="{literal}WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'}){/literal}" id="pubtime" name="pubtime" class="Wdate" type="text" />
							</td>
						</tr>
						<tr>
							<th><label for="isShow">是否上架:</label></th>
							<td>
								<select id="isShow">
									{foreach $isShow as $k => $v}
									<option value="{$k}">{$v}</option>
									{/foreach}
								</select>
							</td>
						</tr>
					</table>
					<input type="hidden" id="typeID" value="{$typeDetail['typeid']}"  />
				</form>
				<div>
					<span class="submitBtn">提交</span>
					<span class="cancelBtn">取消</span>
				</div>
				</center>
			</div>
		</div>
	</div>

{include file="../footer.html"}